﻿using System;


namespace ITM495.OOExamples.Core.Exceptions
{
    /// <summary>
    /// The CustomException class is a very simple example of creating an custom exception class
    /// </summary>
    public class CustomException: ApplicationException
    {
        /// <summary>
        /// Constructor that requires the custom property value
        /// </summary>
        public CustomException(string customProperty)
        {
            CustomProperty = customProperty;
        }

        /// <summary>
        /// Custom properyt (provides some useful information to the user catching this exception
        /// </summary>
        public string CustomProperty { get; private set; }

        /// <summary>
        /// Add a prefix to the build in message property
        /// </summary>
        public override string Message
        {
            get
            {
                return "Custom Exception: " + base.Message;
            }
        }
    }
}
